<?php

function online ( $user ) {
    
	include("inc_configuration.php");
	
   $q="SELECT * FROM $tbl_session WHERE userid=$user";
   $qe=mysql_query($q);
   $qec=mysql_num_rows($qe);
   
   if ($qec>0)
   {
		return "<img src='img/online.png' alt='Online'>";
   }
   else
   {
		return "<img src='img/offline.png' alt='Offline'>";
   }
    
}


function prepareContact ($user)
{
	include("inc_configuration.php");
	require_once("inc/inc_icq.php");
	
	$link="";
	$kontakt="";
		
	$q="SELECT * FROM $tbl_ui WHERE userId=$user";
	$qe=mysql_query($q);
	$qec=mysql_num_rows($qe);
	
	if ($qec>0)
		{
			$qeo=mysql_fetch_object($qe);
			$icq=$qeo->icq;
			if ($icq!=0)
			{
				$link=icqStatus($icq);
				
				$kontakt="ICQ: $icq $link";
			}
		}

	
	
	
	$on=online($user);
	
	$back="<br>$on<br>$kontakt";
	
	return $back;
}
?>